#ifndef RS_SEMAPHORE_HPP
#define RS_SEMAPHORE_HPP

#include "rs/Portability.hpp"
#include "rs/SmartPointer.hpp"

namespace rs
{
    namespace internal
    {
        struct SemaphoreImplementation;
    }
    
    class Semaphore
    {
    private:
        
        typedef SmartPointer< internal::SemaphoreImplementation > SemaphoreImplementationPtr;
        
    public:
        
        Semaphore(UInt32 value);
        
        Semaphore(Semaphore const& other);
        
        ~Semaphore();
        
        void Increment();
        
        void Decrement();        
        
        void Swap(Semaphore& other);
        
        Semaphore& operator=(Semaphore const& other);
        
    private:
        
        SemaphoreImplementationPtr implementation_;
    };
}

#endif // RS_SEMAPHORE_HPP
